/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef LIB2D_GUI_VIEW_SCROLLBAR_H
#define LIB2D_GUI_VIEW_SCROLLBAR_H

#include "Object.h"
#include "Button.h"
#include <math/utl.h>

#include <lib2d/objects/Imagesimple.h>
#include <xml/Object.h>
#include <xml/Stream.h>

namespace liba
{
namespace lib2d
{
namespace gui
{
class ScrollBar;
namespace view
{

class ScrollBar :
	public Object,
	public xml::ObjectANSI
{
	AutoPtr< objects::ImageSimple > image;
	Rect back_rect;
	Rect track_rect;
	const gui::ScrollBar * obj;
public:
	explicit ScrollBar( gui::ScrollBar * obj );
	virtual void render( hard::Renderer * rend );
	virtual bool on_attribute( xml::Provider * prov, const std::string & name, const std::string & value );
	virtual bool on_node( xml::Provider * prov, const std::string & name );
	double get_width()const
	{
		return back_rect.width;
	}
};

} //namespace view
} //namespace gui
} //namespace lib2d
} //namespace liba

using namespace liba;

#endif //LIB2D_GUI_VIEW_SCROLLBAR_H
